package com.qcsec.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qcsec.common.base.BaseEntity;
import com.qcsec.domain.entity.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 测试 mapstruct
 */
@ApiModel
@JsonIgnoreProperties(ignoreUnknown = true)
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class SysUserDto extends BaseEntity {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty("账户")
    private String username;
    @ApiModelProperty("密码")
    private String passwd;
    @ApiModelProperty("姓名")
    private String realName;
    @ApiModelProperty("手机")
    private String telephone;
    @ApiModelProperty("邮箱")
    private String email;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastLoginTime;

//    public static void main(String[] args) {
//        SysUser sysUser = new SysUser().setId(12L).setUsername("admin").setPassword("123456").setRealName("wdp");
//        SysUserDto dto = SysUserMsMapper.INSTANCE.toDto(sysUser);
//        System.out.println(dto);
//    }
}
